<? if ($c = stack('name')) { $s = component_settings($c);

	if (($tid = gccHuuid(param('id'))) && 
		($ticket = datafetch('db_item', 'cs_ticket', "id=$tid AND kind=".TK_RECOVER_PASS))) {
		
		$person = json_decode($ticket['data'], true);

		
		if (($person['email'] = h($person['email'])) && ($d = datafetch('db_item', 'cs_person', "email='$person[email]'"))) {

			$DATA['components'][$c]['data'] = $person;




		} else {
//debug('email is empty or not registered at all');
			header("Location: "._transformURL($CURRENT->url, array('remove_params' => 'all', 'add_level' => 'wrong')));
			exit;
		}

	} else {
//debug('wrong ticket');
		header("Location: "._transformURL($CURRENT->url, array('remove_params' => 'all', 'add_level' => 'wrong')));
		exit;
	}


unstack();
}